package com.mydistibute.distibutelearn.blockedqueen;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * @author victorydeng
 * @Classname MyTest
 * @Description TODO
 * @Date 2020/6/1 9:53
 * @Created by victorydeng
 */
public class MyTest {

   static BlockingQueue<String> queue = new LinkedBlockingDeque<>(10);

    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            queue.add("mic");
        });
        Thread t2 = new Thread(()->{
            try {
                queue.take();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t1.start();
        t2.start();


    }
}
